package com.wyzz.hr.pojo.base;

import java.io.Serializable;
import java.util.Set;
import java.util.TreeSet;

import com.wyzz.hr.pojo.Ecptype;
import com.wyzz.hr.pojo.Empsalaryadj;

public abstract class BaseEcptype implements Serializable {

	public BaseEcptype() {
		hashCode = 0x80000000;
		initialize();
	}

	public BaseEcptype(String id) {
		hashCode = 0x80000000;
		setId(id);
		initialize();
	}

	public BaseEcptype(String id, String ecptypeName) {
		hashCode = 0x80000000;
		setId(id);
		setEcptypeName(ecptypeName);
		initialize();
	}

	protected void initialize() {
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
		hashCode = 0x80000000;
	}

	public String getEcptypeName() {
		return ecptypeName;
	}

	public void setEcptypeName(String ecptypeName) {
		this.ecptypeName = ecptypeName;
	}

	public String getEcptypeDesc() {
		return ecptypeDesc;
	}

	public void setEcptypeDesc(String ecptypeDesc) {
		this.ecptypeDesc = ecptypeDesc;
	}

	public Set getEmpcompaplans() {
		return empcompaplans;
	}

	public void setEmpcompaplans(Set empcompaplans) {
		this.empcompaplans = empcompaplans;
	}

	public void addToempcompaplans(Empsalaryadj empcompaplan) {
		if (null == getEmpcompaplans())
			setEmpcompaplans(new TreeSet());
		getEmpcompaplans().add(empcompaplan);
	}

	public boolean equals(Object obj) {
		if (null == obj)
			return false;
		if (!(obj instanceof Ecptype))
			return false;
		Ecptype ecptype = (Ecptype) obj;
		if (null == getId() || null == ecptype.getId())
			return false;
		else
			return getId().equals(ecptype.getId());
	}

	public int hashCode() {
		if (0x80000000 == hashCode) {
			if (null == getId())
				return super.hashCode();
			String hashStr = (new StringBuilder()).append(getClass().getName())
					.append(":").append(getId().hashCode()).toString();
			hashCode = hashStr.hashCode();
		}
		return hashCode;
	}

	public String toString() {
		return super.toString();
	}

	public Integer getEcptypeSortId() {
		return ecptypeSortId;
	}

	public void setEcptypeSortId(Integer ecptypeSortId) {
		this.ecptypeSortId = ecptypeSortId;
	}

	public static String REF = "Ecptype";
	public static String PROP_ECPTYPE_DESC = "ecptypeDesc";
	public static String PROP_ID = "id";
	public static String PROP_ECPTYPE_NAME = "ecptypeName";
	public static String PROP_ECPTYPE_SORT_ID = "ecptypeSortId";
	private int hashCode;
	private String id;
	private String ecptypeName;
	private String ecptypeDesc;
	private Integer ecptypeSortId;
	private Set empcompaplans;

}
